
import requests
# 请求地址
url = "https://lab.isaaclin.cn/nCoV/api/area"

res = requests.get(url).json()

result_list = res['results']
result = []
for item in result_list:
    if item['countryFullName']:
        name = item['countryFullName'].replace('United States of America','United States')  # 名称
        cfc = item['confirmedCount'] # 累计确诊
        result.append( [name, cfc])

from pyecharts.charts import Map
from pyecharts import options as opts
import datetime

update_time = datetime.date.today()

map = Map()
map.add('全球疫情', data_pair=result, maptype='world', is_map_symbol_show=False)
map.set_global_opts(
    title_opts=opts.TitleOpts(
        title='全球疫情地图',
        subtitle='更新时间：{}'.format(update_time)
    ),
    visualmap_opts=opts.VisualMapOpts(
        is_show=True,
        max_=10000000
    )
)

map.render('01全球疫情地图.html')